package com.example.Life_course.controller;


import com.example.Life_course.service.LifeCourseService;
import com.example.common.PageUtils;
import com.example.common.dto.BaseReturnDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tc
 * @since 2022-12-08
 */
@RestController
@RequestMapping("/lifeCourseDO")
public class LifeCourseController {
    @Autowired
    LifeCourseService lifeCourseService;
    @GetMapping("/query")
    public BaseReturnDto<?> query(@RequestParam(defaultValue = "1") Integer pageNum,
                                 @RequestParam (defaultValue = "4")Integer pageSize,
                                 @RequestParam(value = "search",required = false,defaultValue = "") String search){
        PageUtils page  = lifeCourseService.QueryLifeCourse(pageNum,pageSize,search);
        return  BaseReturnDto.success().data(page);
    }

}

